

function Check(){
    let btn = document.getElementById('btn');
    let str = String(btn.classList);
    if(str.lastIndexOf('am-disabled') == -1){
        btn.classList.add('am-disabled');
    }
}


function passwordCheck(){
    let tip = document.getElementById('tip');
    let btn = document.getElementById('btn');
    let newpw = document.getElementById('user-new-password');
    let cnewpw = document.getElementById('user-confirm-password');
    if(cnewpw.value != ''){
        if(newpw.value != cnewpw.value){
            tip.style.display = 'block';
        }else{
            btn.classList.remove('am-disabled');
            tip.style.display = 'none';
        }
    }else{
        return
    }
}
function confirmpasswordCheck(){
    let tip = document.getElementById('tip');
    let btn = document.getElementById('btn');
    let newpw = document.getElementById('user-new-password');
    let cnewpw = document.getElementById('user-confirm-password');
    if(cnewpw.value != ''){
        if(newpw.value != cnewpw.value){
            tip.style.display = 'block';
        }else{
            btn.classList.remove('am-disabled');
            tip.style.display = 'none';
        }
    }else{
        return
    }
}


